$(function(){

	
	var dates=$("#from,#to").datepicker({
		defaultDate:"+1w",
		numberOfMonths:2,
		onSelect:function(selectdDate){
			
			var option=(this.id=="from")?"minDate":"maxDate",
					date=$.datepicker.parseDate($.datepicker.defaults.dateFormat,selectedDate);
			dates.not(this).datepicker("option",option,date);
		}
		
		
		
	});
});

function save(id){
	 var ifshow = $(":radio[name='ifshow']:checked").val();
	
	 $.post("../crm32/GongGaochange",{"ifshow":ifshow,"id":id},function(data){
		alert("修改显示状态成功！");
		window.location.reload();
	}); 
	
}

function selectByDate(){
	
	
	var fromtime=document.getElementById("from").value;
	var totime=document.getElementById("to").value;
	alert("fromtime:"+fromtime);
	
	document.getElementById('from').value=fromtime;
	document.getElementById('to').value=totime;
	
	
	 $.post("../crm32/GongGao",{"fromtime":fromtime,"totime":totime},function(data){
		 window.location.reload();
		}); 
	
	
}